import type { MenuProps } from 'antd';
import { 
  HomeOutlined, 
  PictureOutlined, 
  UnorderedListOutlined, 
  AppstoreAddOutlined,
  ProfileOutlined,
  FileSearchOutlined,
  UserAddOutlined,
  UsergroupDeleteOutlined,
  SettingOutlined
} from "@ant-design/icons";

import Home from '@/views/home/Index'

import BannerList from '@/views/banner/List'
import BannerAdd from '@/views/banner/Add'

import ProList from '@/views/pro/List'
import ProSearch from '@/views/pro/Search'

import AccountList from '@/views/account/List'
import AccountAdmin from '@/views/account/Admin'

import Set from '@/views/set/Index'

import Echarts from '@/views/data/Echarts'
import HighCharts from '@/views/data/HighCharts'

import Braft from '@/views/edit/Braft'
import Md from '@/views/edit/Md'

import Import from '@/views/excel/Import'
import Export from '@/views/excel/Export'

import BaiduMap from '@/views/map/Baidu'
// import GaodeMap from '@/views/map/Gaode'

// 官方文档提供
type MenuItem = Required<MenuProps>['items'][number];
export type MyMenuItem = MenuItem & { // 自己扩展的类型
  path: string,
  label: string,
  icon?: React.ReactNode, 
  redirect?: string,
  children?: MyMenuItem[],
  element?: React.ReactNode,
  hidden?: boolean
}
const menus: MyMenuItem[] = [
  {
    path: '/',
    key: '/',
    label: '系统首页',
    icon: <HomeOutlined />,
    element: <Home />
  },
  {
    path: '/banner',
    key: '/banner',
    label: '轮播图管理',
    icon: <PictureOutlined />,
    redirect: '/banner/list',
    children: [
      {
        path: '/banner/list',
        key: '/banner/list',
        label: '轮播图列表',
        icon: <UnorderedListOutlined />,
        element: <BannerList />
      },
      {
        path: '/banner/add',
        key: '/banner/add',
        label: '添加轮播图',
        icon: <AppstoreAddOutlined />,
        element: <BannerAdd />,
        hidden: true
      }
    ]
  },
  {
    path: '/pro',
    key: '/pro',
    label: '商品管理',
    redirect: '/pro/list',
    icon: <ProfileOutlined />,
    children: [
      {
        path: '/pro/list',
        key: '/pro/list',
        label: '商品列表',
        icon: <UnorderedListOutlined />,
        element: <ProList />
      },
      {
        path: '/pro/search',
        key: '/pro/search',
        label: '筛选列表',
        icon: <FileSearchOutlined />,
        element: <ProSearch />
      }
    ]
  },
  {
    path: '/account',
    key: '/account',
    label: '账户管理',
    redirect: '/account/list',
    icon: <UsergroupDeleteOutlined />,
    children: [
      {
        path: '/account/list',
        key: '/account/list',
        label: '用户列表',
        icon: <UnorderedListOutlined />,
        element: <AccountList />
      },
      {
        path: '/account/admin',
        key: '/account/admin',
        label: '管理员列表',
        icon: <UserAddOutlined />,
        element: <AccountAdmin />
      }
    ]
  },
  {
    path: '/set',
    key: '/set',
    label: '设置',
    icon: <SettingOutlined />,
    element: <Set />,
    hidden: true
  },
  {
    path: '/data',
    key: '/data',
    label: '数据可视化',
    redirect: '/data/echarts',
    icon: <UsergroupDeleteOutlined />,
    children: [
      {
        path: '/data/echarts',
        key: '/data/echarts',
        label: 'Echarts',
        icon: <UnorderedListOutlined />,
        element: <Echarts />
      },
      {
        path: '/data/highcharts',
        key: '/data/highcharts',
        label: 'highcharts',
        icon: <UserAddOutlined />,
        element: <HighCharts />
      }
    ]
  },
  {
    path: '/edit',
    key: '/edit',
    label: '编辑器',
    redirect: '/edit/braft',
    icon: <UsergroupDeleteOutlined />,
    children: [
      {
        path: '/edit/braft',
        key: '/edit/braft',
        label: '富文本编辑器',
        icon: <UnorderedListOutlined />,
        element: <Braft />
      },
      {
        path: '/edit/md',
        key: '/edit/md',
        label: 'markdown编辑器',
        icon: <UserAddOutlined />,
        element: <Md />
      }
    ]
  },
  {
    path: '/excel',
    key: '/excel',
    label: '导入以及导出',
    redirect: '/excel/import',
    icon: <UsergroupDeleteOutlined />,
    children: [
      {
        path: '/excel/import',
        key: '/excel/import',
        label: '导入',
        icon: <UnorderedListOutlined />,
        element: <Import />
      },
      {
        path: '/excel/export',
        key: '/excel/export',
        label: '导出',
        icon: <UserAddOutlined />,
        element: <Export />
      }
    ]
  },
  {
    path: '/map',
    key: '/map',
    label: '地图',
    redirect: '/map/baidu',
    icon: <UsergroupDeleteOutlined />,
    children: [
      {
        path: '/map/baidu',
        key: '/map/baidu',
        label: '百度地图',
        icon: <UnorderedListOutlined />,
        element: <BaiduMap />
      },
      // {
      //   path: '/map/gaode',
      //   key: '/map/gaode',
      //   label: '高德地图',
      //   icon: <UserAddOutlined />,
      //   element: <GaodeMap />
      // }
    ]
  },
]

export default menus